package com.ruoyi.dataSet.service;

import com.ruoyi.dataSet.DTO.DocumentSegmentCreateRequest;
import com.ruoyi.dataSet.DTO.DocumentSegmentUpdateRequest;
import org.springframework.stereotype.Service;
import com.ruoyi.dataSet.http.HttpClientForSegment;
import java.io.IOException;

@Service
public class DocumentSegmentService {

    // 创建文档分段
    public String createSegment(String datasetId, String documentId, DocumentSegmentCreateRequest request) throws IOException {
        return HttpClientForSegment.createSegment(datasetId, documentId, request);
    }

    // 获取文档分段
    public String getSegments(String datasetId, String documentId, String page, String limit) throws IOException {
        return HttpClientForSegment.getSegments(datasetId, documentId, page, limit);
    }

    // 删除文档分段
    public String deleteSegment(String datasetId, String documentId, String segmentId) throws IOException {
        return HttpClientForSegment.deleteSegment(datasetId, documentId, segmentId);
    }

    // 更新文档分段
    public String updateSegment(String datasetId, String documentId, String segmentId, DocumentSegmentUpdateRequest request) throws IOException {
        return HttpClientForSegment.updateSegment(datasetId, documentId, segmentId, request);
    }
}
